package com.chris.vue.service;

import com.chris.vue.models.items.MenuInfoItem;
import com.chris.vue.models.items.MenuItem;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Chris Chan
 * 2020/8/18 3:17
 * Use for:
 * Explain:
 */
@Service
public class UserService {
    public List<MenuItem> getMenus() {
        List<MenuItem> menuItems = new ArrayList<>(16);
        menuItems.add(new MenuItem(1L, 0L, "商品", "product", 0, 0, "pms", 0));
        menuItems.add(new MenuItem(2L, 1L, "商品列表", "product-list", 1, 0, "product", 0));
        menuItems.add(new MenuItem(3L, 1L, "添加商品", "product-add", 1, 0, "addProduct", 0));
        menuItems.add(new MenuItem(4L, 1L, "商品分类", "product-cate", 1, 0, "productCate", 0));

        //自己扩展的菜单
        menuItems.add(new MenuItem(5L, 0L, "梅奴儿商城", "product", 0, 0, "minur", 0));
        menuItems.add(new MenuItem(6L, 5L, "说明", "product-list", 1, 0, "minur-info", 0));
        menuItems.add(new MenuItem(7L, 5L, "商品列表", "product-list", 1, 0, "goodsList", 0));
        menuItems.add(new MenuItem(8L, 5L, "商品详情", "product-attr", 1, 0, "goodsDetails", 0));

        return menuItems;
    }

    public List<MenuInfoItem> getMenuInfos() {
        List<MenuInfoItem> menuInfoItems=new ArrayList<>(16);
        //一级菜单
        MenuInfoItem mnuDemo=new MenuInfoItem("menuInfoDemo","/menuInfoDemo","/menuInfoDemo/menuSub1","#","minur_info_demo","纯动态菜单","product",0,0,"Admin");
        MenuInfoItem mnuGoods=new MenuInfoItem("goods","/goods","/goods/goodslist1","#","goods","梅奴儿商品","product",0,0,"Admin");
        MenuInfoItem mnuElUi=new MenuInfoItem("elements","/elements","/elements/button","#","elements","视觉控件","product",0,0,"Admin");
        MenuInfoItem mnuEcharts=new MenuInfoItem("echarts","/echarts","/echarts/line","#","echarts","图表","product",0,0,"Admin");

        //一级菜单的子菜单
        ///演示
        List<MenuInfoItem> childrenDemo=new ArrayList<>(16);
        childrenDemo.add(new MenuInfoItem("demo-info","info","#","/menuInfoDemo/info","demo-info","说明","product-attr",0,0,"Admin"));
        childrenDemo.add(new MenuInfoItem("menuSub1","menuSub1","#","/menuInfoDemo/menuSub1","menuSub1","子菜单一","product-attr",0,0,"Admin"));
        childrenDemo.add(new MenuInfoItem("menuSub2","menuSub2","#","/menuInfoDemo/menuSub2","menuSub2","子菜单二","product-list",1,0,"Admin"));
        mnuDemo.setChildren(childrenDemo);
        menuInfoItems.add(mnuDemo);

        ///梅奴儿商品
        List<MenuInfoItem> childrenGoods=new ArrayList<>(16);
        childrenGoods.add(new MenuInfoItem("goods-info","info","#","/goods/info","goods-info","说明","product-attr",0,0,"Admin"));
        childrenGoods.add(new MenuInfoItem("goodslist1","goodslist1","#","/goods/goodslist1","goodslist1","商品列表","sms",0,0,"Admin"));
        childrenGoods.add(new MenuInfoItem("goodslist2","goodslist2","#","/goods/goodslist2","goodslist2","商品列表(组件)","sms",0,0,"Admin"));
        childrenGoods.add(new MenuInfoItem("goodsdetails","goodsdetails","#","/goods/goodsdetails","goodsdetails","商品详情","sms",1,0,"Admin"));
        mnuGoods.setChildren(childrenGoods);
        menuInfoItems.add(mnuGoods);

        ////element-ui
        List<MenuInfoItem> childrenElUi = new ArrayList<>(16);
        childrenElUi.add(new MenuInfoItem("button", "button", "#", "/elements/button", "button", "按钮", "product-attr", 0, 0, "Admin"));
        childrenElUi.add(new MenuInfoItem("table", "table", "#", "/elements/table", "table", "表格", "product-attr", 0, 0, "Admin"));
        childrenElUi.add(new MenuInfoItem("navmenu", "navmenu", "#", "/elements/navmenu", "navmenu", "导航菜单", "product-attr", 0, 0, "Admin"));
        mnuElUi.setChildren(childrenElUi);
        menuInfoItems.add(mnuElUi);

        ////echarts
        List<MenuInfoItem> childrenEcharts = new ArrayList<>(16);
        childrenEcharts.add(new MenuInfoItem("echarts-info", "info", "#", "/echarts/info", "echarts-info", "说明", "product-attr", 0, 0, "Admin"));
        childrenEcharts.add(new MenuInfoItem("line", "line", "#", "/echarts/line", "line", "曲线图", "product-attr", 0, 0, "Admin"));
        childrenEcharts.add(new MenuInfoItem("bar", "bar", "#", "/echarts/bar", "bar", "柱状图", "product-attr", 0, 0, "Admin"));
        childrenEcharts.add(new MenuInfoItem("pie", "pie", "#", "/echarts/pie", "pie", "饼状图", "product-attr", 0, 0, "Admin"));
        childrenEcharts.add(new MenuInfoItem("mix", "mix", "#", "/echarts/mix", "mix", "混合图", "product-attr", 0, 0, "Admin"));
        childrenEcharts.add(new MenuInfoItem("china", "china", "#", "/echarts/chinamap", "chinamap", "中国地图", "product-attr", 0, 0, "Admin"));
        childrenEcharts.add(new MenuInfoItem("china2", "china2", "#", "/echarts/chinamap2", "chinamap2", "中国地图2", "product-attr", 0, 0, "Admin"));
        mnuEcharts.setChildren(childrenEcharts);
        menuInfoItems.add(mnuEcharts);

        return menuInfoItems;
    }
}
